---
layout: m1x_soap
title: Product Custom Option Update
---

<h3><a name="product_custom_option.update-Module%3AComplexProductAPI"></a>Module: Complex Product API</h3>

<h4><a name="product_custom_option.update-Resource%3Aproductcustomoption"></a>Resource: product_custom_option</h4>


<h5><a name="product_custom_option.update-Method%3A"></a>Method:</h5>

<ul>
	<li>product_custom_option.update (SOAP V1)</li>
	<li>catalogProductCustomOptionUpdate (SOAP V2)</li>
</ul>


<p>Allows you to update the required product custom option.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> optionId </td>
<td> Option ID </td>
</tr>
<tr>
<td> array </td>
<td> data </td>
<td> Array of catalogProductCustomOptionToUpdate </td>
</tr>
<tr>
<td> string </td>
<td> store </td>
<td> Store view ID or code (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean\int </td>
<td> True (1) if the custom option is updated </td>
</tr>
</tbody></table>


<p>The <b>catalogProductCustomOptionToUpdate</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> title <br class="atl-forced-newline" /> </td>
<td> Title of the custom option to be updated </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> type <br class="atl-forced-newline" /> </td>
<td> Custom option type </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sort_order <br class="atl-forced-newline" /> </td>
<td> Custom option sort order </td>
</tr>
<tr>
<td> int </td>
<td> is_require <br class="atl-forced-newline" /> </td>
<td> Defines whether the custom option is required </td>
</tr>
<tr>
<td> array </td>
<td> additional_fields <br class="atl-forced-newline" /> </td>
<td> Array of catalogProductCustomOptionAdditionalFields </td>
</tr>
</tbody></table>


<p>The <b>catalogProductCustomOptionAdditionalFields</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> title <br class="atl-forced-newline" /> </td>
<td> Custom option title </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> price <br class="atl-forced-newline" /> </td>
<td> Custom option price </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> price_type <br class="atl-forced-newline" /> </td>
<td> Price type. Possible values are as follows: "fixed" or "percent" <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sku <br class="atl-forced-newline" /> </td>
<td> Custom option SKU <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> max_characters <br class="atl-forced-newline" /> </td>
<td> Maximum number of characters for the customer input on the frontend (optional) <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sort_order <br class="atl-forced-newline" /> </td>
<td> Custom option sort order </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> file_extension <br class="atl-forced-newline" /> </td>
<td> List of file extensions allowed to upload by the user on the frontend (optional; for the <b>File</b> input type) <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> image_size_x <br class="atl-forced-newline" /> </td>
<td> Width limit for uploaded images (optional; for the <b>File</b> input type) <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> image_size_y <br class="atl-forced-newline" /> </td>
<td> Height limit for uploaded images (optional; for the <b>File</b> input type) <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> value_id <br class="atl-forced-newline" /> </td>
<td> Value ID </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 101 </td>
<td> Product with requested id does not exist. </td>
</tr>
<tr>
<td> 102 </td>
<td> Provided data is invalid. </td>
</tr>
<tr>
<td> 103 </td>
<td> Error while saving an option. Details are in the error message. </td>
</tr>
<tr>
<td> 104 </td>
<td> Store with requested code/id does not exist. </td>
</tr>
<tr>
<td> 105 </td>
<td> Option with requested id does not exist. </td>
</tr>
<tr>
<td> 106 </td>
<td> Invalid option type provided. Call 'types' to get list of allowed option types. </td>
</tr>
</tbody></table>


<h4><a name="product_custom_option.update-Examples"></a>Examples</h4>

<h5><a name="product_custom_option.update-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$selectOptionId = 1379;
$selectOptionValueId = 794;
$textOptionId = 1380;
$fileOptionId = 1381;

// Update custom option of Text Field type
$customTextFieldOption = array(
    "title" =&gt; "Custom Text Field Option Title Updated",
    "type" =&gt; "field",
    "is_require" =&gt; 1,
    "sort_order" =&gt; 20,
    "additional_fields" =&gt; array(
        array(
            "price" =&gt; 13.00,
            "price_type" =&gt; "fixed",
            "sku" =&gt; "custom_text_option_sku_updated",
            "max_characters" =&gt; 127
        )
    )
);
$resultCustomTextFieldOptionUpdate = $proxy-&gt;call(
    $sessionId,
    "product_custom_option.update",
    array(
         $textOptionId,
         $customTextFieldOption
    )
);

// Update custom option of File type
$customFileOption = array(
    "title" =&gt; "Custom File Option Title Updated",
    "additional_fields" =&gt; array(
        array(
            "image_size_x" =&gt; 800,
            "image_size_y" =&gt; 999
        )
    )
);
$resultCustomFileOptionUpdate = $proxy-&gt;call(
    $sessionId,
    "product_custom_option.update",
    array(
         $fileOptionId,
         $customFileOption
    )
);


// Update custom option of Dropdown type
$customDropdownOption = array(
    "title" =&gt; "Custom Dropdown Option Title Updated to Multiselect",
    "type" =&gt; "multiple",
    "additional_fields" =&gt; array(
        array(
            "value_id" =&gt; $selectOptionValueId,
            "price" =&gt; 14.00,
            "price_type" =&gt; 'percent',
            "sku" =&gt; "custom_select_option_sku_1 updated",
            "sort_order" =&gt; 26
        )
    )
);
$resultCustomDropdownOptionUpdate = $proxy-&gt;call(
    $sessionId,
    "product_custom_option.update",
    array(
         $selectOptionId,
         $customDropdownOption
    )
);</pre>
		</div>
</div></div>


<h5><a name="product_custom_option.update-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$result = $proxy-&gt;catalogProductCustomOptionUpdate($sessionId, '1', array(
'title' =&gt; 'title_updated',
'is_require' =&gt; 0,
'sort_order' =&gt; '2'
));
var_dump($result);</pre>
		</div>
</div></div>

<h5><a name="product_custom_option.update-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductCustomOptionUpdate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'optionId' =&gt; '1', 'data' =&gt; ((object)array(
'title' =&gt; 'title_updated',
'is_require' =&gt; 0,
'sort_order' =&gt; '2'
))));
var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
